package kr.co.boogui.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class AdminChkService {
	
	public static String adminChk(HttpServletRequest req, String page) {
		HttpSession sess = req.getSession();
		String viewPage = "f|/WEB-INF/jsp/admin/admin.jsp";
		try {
			if (sess.getAttribute("uid").equals("admin")) {
				req.setAttribute("action", page + ".jsp");
			} else {
				viewPage = "r|index.bi";
			}
		} catch (NullPointerException ne) {
			viewPage = "r|index.bi";
		}
		
		return viewPage;
	}

}
